<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>登录</title>
  <link rel="stylesheet" type="text/css" href="res/static/css/main.css">
  <link rel="stylesheet" type="text/css" href="res/layui/css/layui.css">
  <script type="text/javascript" src="res/layui/layui.js"></script>
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
</head>
<body>

<div class="site-nav-bg">
  <div class="site-nav w1200">
    <p class="sn-back-home">
      <i class="layui-icon layui-icon-home"></i>
      <a href="${pageContext.request.contextPath}/goods/query">首页</a>
    </p>
    <div class="sn-quick-menu">
      <div class="login"><a href="login.jsp">登录</a></div>
      <div class="sp-cart"><a href="shopcart.jsp">购物车</a><span></span></div>
    </div>
  </div>
</div>



<div class="header">
  <div class="headerLayout w1200">
    <div class="headerCon">
      <h1 class="mallLogo">
        <a href="#" title="母婴商城">
          <img src="res/static/img/logo.png">
        </a>
      </h1>
      <div class="mallSearch">
        <form action="" class="layui-form" novalidate>
          <input type="text" name="title" required  lay-verify="required" autocomplete="off" class="layui-input" placeholder="请输入需要的商品">
          <button class="layui-btn" lay-submit lay-filter="formDemo">
            <i class="layui-icon layui-icon-search"></i>
          </button>
          <input type="hidden" name="" value="">
        </form>
      </div>
    </div>
  </div>
</div>


<div class="content content-nav-base  login-content">
  <div class="main-nav">
    <div class="inner-cont0">
      <div class="inner-cont1 w1200">
        <div class="inner-cont2">
          <a href="commodity.jsp" class="active">所有商品</a>
          <a href="buytoday.html">今日团购</a>
          <a href="information.html">母婴资讯</a>
          <a href="about.html">关于我们</a>
        </div>
      </div>
    </div>
  </div>
  <div class="login-bg">
    <div class="login-cont w1200">
      <div class="form-box">
        <form class="layui-form" action="">
          <legend>登录</legend>
          <div class="layui-form-item">
            <div class="layui-inline veri-code">
              <div class="layui-input-inline">
                <input id="name" type="text" name="uname"  placeholder="请输入昵称" autocomplete="off" class="layui-input">
                <!--                  <input type="button" class="layui-btn" id="find"  value="验证码" /> -->
              </div>
              <div class="layui-inline veri-code">
                <div class="layui-input-inline">
                  <input id="pwd" type="password" name="pwd"  placeholder="请输入密码" autocomplete="off" class="layui-input">
                  <!--                  <input type="button" class="layui-btn" id="find"  value="验证码" /> -->
                </div>
              </div>
            </div>
          </div>
          <div class="layui-form-item login-btn">
            <div class="layui-input-block">
              <input type="button" value="登录" id="dl" class="layui-btn" style="width: 300px">
              <br>
              <br>
              <a href="sign.jsp" class="layui-btn" style="width: 300px">注册</a>
            </div>
          </div>
        </form>
      </div>
    </div>
  </div>
</div>
<div class="footer">
  <div class="ng-promise-box">
    <div class="ng-promise w1200">
      <p class="text">
        <a class="icon1" href="javascript:;">7天无理由退换货</a>
        <a class="icon2" href="javascript:;">满99元全场免邮</a>
        <a class="icon3" style="margin-right: 0" href="javascript:;">100%品质保证</a>
      </p>
    </div>
  </div>
  <div class="mod_help w1200">
    <p>
      <a href="javascript:;">关于我们</a>
      <span>|</span>
      <a href="javascript:;">帮助中心</a>
      <span>|</span>
      <a href="javascript:;">售后服务</a>
      <span>|</span>
      <a href="javascript:;">母婴资讯</a>
      <span>|</span>
      <a href="javascript:;">关于货源</a>
    </p>
    <p class="coty">母婴商城版权所有 &copy; 2012-2020</p>
  </div>
</div>
<script type="text/javascript">
  layui.config({
    base: 'res/static/js/util' //你存放新模块的目录，注意，不是layui的模块目录
  }).use(['jquery','form'],function(){
    var $ = layui.$,form = layui.form;

    $(".layui-input-block #dl").click(function() {
      var uName=$('#name').val();
      var pwd=$('#pwd').val();
      if(uName.length=0||pwd.length==0){
        return;
      }
      $.ajax({
        type:"get",
        url:"users/log",
        data:"uName="+uName+"&pwd="+pwd,
        dataType:"json",//返回的
        success:function(data) {
          if(data>0){
            window.location="goods/query";
          }
        },
        error:function(msg) {
          alert("添加失败")
          console.log(msg);
        }
      });
    })
    <%--$(".layui-form-item .layui-input-block #zc").click(function() {--%>
    <%--  window.location.href='${pageContext.request.contextPath}'+"/sign.jsp";--%>
    <%--})--%>
  })
</script>

</body>
</html>